#include <stdio.h>
#include <sys/time.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <unistd.h>
#include <stdlib.h>
#include <fcntl.h>
#include <errno.h>
#include <string.h>

int main(int argc,char **argv)
{
    struct timeval timeout={5,0};
    fd_set r_set;
    fd_set w_set;
    
    FD_SET(0,&r_set);
    int ret = select(1,&r_set,NULL,NULL,&timeout);
    printf("hello world  + %d\n",ret);
    if(FD_ISSET(0,&r_set))
    {
        char buff[1024];
        read(0,buff,sizeof(buff));
        printf("%s",buff);
    }
    return 0;
}